package com.kkb.robotcustomerservice.entities;

import java.util.Arrays;
import java.util.List;

/**
 * 用于接收从前端上传的Excel文件中的问题
 */
public class QuestionTemplate {
    /**
     * 标准问题
     */
    String standardQuestion;
    /**
     * 领域（大）
     */
    String big_cate;
    /**
     * 意图
     */
    String intention;
    /**
     * 关键词
     */
    List<String> keywords;
    /**
     * 相似问题
     */
    List<String> similarQuestion;

    public QuestionTemplate(){
    }

    /**
     * 统一传入字符串，然后自动解析成List
     * @return
     */
    public QuestionTemplate(String standardQuestion, String big_cate, String intention, String keywords, String similarQuestion) {
        this.standardQuestion = standardQuestion;
        this.big_cate = big_cate;
        this.intention = intention;
        //注意，这是是英文的 ; 号
        this.keywords = Arrays.asList(keywords.split(";"));
        this.similarQuestion = Arrays.asList(similarQuestion.split(";"));
    }

    @Override
    public String toString() {
        return "QuestionTemplate{" +
                "standardQuestion='" + standardQuestion + '\'' +
                ", big_cate='" + big_cate + '\'' +
                ", intention='" + intention + '\'' +
                ", keywords=" + keywords +
                ", similarQuestion=" + similarQuestion +
                '}';
    }
}
